package threadpool;

import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

/**
 * @Author: admin
 * @Description:
 * @Date: 2018/8/5 16:46
 */

public class ScheduledExecutor {
    public static void main(String[] args) {
        ScheduledExecutorService scheduledThreadPool= Executors.newScheduledThreadPool(5);
        scheduledThreadPool.schedule(new Runnable() {
            public void run() {
                System.out.println(Thread.currentThread().getId()+"\t"+"delay 3 seconds");
            }
        },3, TimeUnit.SECONDS);
    }
}
